<?php

if( !defined('IN_SEC') ){
	exit('Access Denied.');
}

class Cache{

	public static $instance = null;

	public static function instance(){
		if ( self::$instance == null ){
			$config = &conf('cache');
			$cache = $config['memcache'] ? 'memcached' : 'supcache';
			self::$instance = core::driver($cache, 1, true);
		}
		return self::$instance;
	}

	public static function set($key, $var = '', $flag = 0, $expire = 0){
		return false;
		self::instance();
		return self::$instance->set($key, $var, $flag, $expire);
	}

	public static function add($key, $var = '', $flag = 0, $expire = 0){
		self::instance();
		return self::$instance->add($key, $var, $flag, $expire);
	}

	public static function get($key, $flags = 0){
		return false;
		self::instance();
		return self::$instance->get($key, $flags);
	}

	public static function del($key){
		self::instance();
		return self::$instance->del($key);
	}

	public static function flush(){
		self::instance();
		return self::$instance->flush();
	}

}